package com.dom.common.exception;

import com.dom.common.constants.ConstantError;
import lombok.Data;

/**
 * @Description 业务异常类
 * @Author xllei
 * @Date 2018/11/6 下午8:11
 * @Version 1.0
 **/
@Data
public class ServiceException extends RuntimeException {
    private String code;

    public ServiceException(String code, String message) {
        super(message);
        this.code = code;
    }

    public ServiceException(ConstantError errorEnum) {
        super(errorEnum.getErrMsg());
        this.code = errorEnum.getErrCode();
    }
}
